import Request from '@/request/index'

/**
 * 后台数据接口
 */

const serveapi = {
  addAvatar(username, data) {
    return request({
      method: 'post',
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      url: 'http://localhost:3000/api/v1/ncov/avatar/' + username,
      data: data
    })
  },
  getAllClass() {
    return Request({
      method: 'get',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      url: 'http://localhost:3000/api/v1/ncov/getAllClass'
    })
  },
  getAllCollege() {
    return Request({
      method: 'get',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      url: 'http://localhost:3000/api/v1/ncov/getAllCollege'
    })
  },
  getUserInfo(username) {
    return Request({
      method: 'get',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      url: 'http://localhost:3000/api/v1/ncov/profile/' + username
    })
  },
  register(data) {
    return Request({
      method: 'post',
      headers: {
        'Content-Type': 'appllication/json; charset=UTF-8'
      },
      url: 'http://localhost:3000/api/v1/ncov/register',
      data: data
    })
  },
  login(data) {
    return Request({
      method: 'post',
      headers: {
        'Content-Type': 'application/json; charset=UTF-8'
      },
      // url: '/server/login',
      url: 'http://localhost:3000/api/v1/ncov/login',
      data: data
    })
  }
  // sendMessage(data) {
  //   return Request.get(
  //     `https://api.it120.cc/yinlu1server/verification/sms/get`, {
  //       data
  //     }
  //   )
  // }
}
export default serveapi
